package com.example.asd;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

public class JiuGongGeActivity extends Activity

{
	private String userStr;
	private ViewHolder viewHolder;

	class ViewHolder {
		private ImageView imageView1;
		private Button bt1;
		private Button bt2;
		private Button bt3;
		private Button bt4;
		private Button bt5;
		private Button bt6;
		private Button bt7;
		private Button bt8;
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_jiugongge);
		viewHolder = new ViewHolder();
		iniComponent();
		userStr = getIntent().getExtras().getString("user");
	}

	private void iniComponent() {
		viewHolder.imageView1 = (ImageView) findViewById(R.id.imageView1);
		viewHolder.bt1 = (Button) findViewById(R.id.button1);
		viewHolder.bt2 = (Button) findViewById(R.id.button2);
		viewHolder.bt3 = (Button) findViewById(R.id.button3);
		viewHolder.bt4 = (Button) findViewById(R.id.button4);
		viewHolder.bt5 = (Button) findViewById(R.id.button5);
		viewHolder.bt6 = (Button) findViewById(R.id.button6);
		viewHolder.bt7 = (Button) findViewById(R.id.button7);
		viewHolder.bt8 = (Button) findViewById(R.id.button8);

		viewHolder.bt1.setOnClickListener(clickListener);
		viewHolder.bt2.setOnClickListener(clickListener);
		viewHolder.bt3.setOnClickListener(clickListener);
		viewHolder.bt4.setOnClickListener(clickListener);
		viewHolder.bt5.setOnClickListener(clickListener);
		viewHolder.bt6.setOnClickListener(clickListener);
		viewHolder.bt7.setOnClickListener(clickListener);
		viewHolder.bt8.setOnClickListener(clickListener);
	}

	private View.OnClickListener clickListener = new View.OnClickListener() {

		public void onClick(View v) {
			switch (v.getId()) {
			case R.id.imageView1:
				finish();
				break;
			case R.id.button1:
				startActivity(new Intent(JiuGongGeActivity.this,
						LaiLiaoActivity.class));
				break;
			case R.id.button2:
				Intent intent=new Intent(JiuGongGeActivity.this,
						ZhiJianActivity.class);
				intent.putExtra("user",userStr);
				startActivity(intent);
				break;
			case R.id.button3:
				startActivity(new Intent(JiuGongGeActivity.this,
						HuiTuActivity.class));
				break;
			case R.id.button4:
				startActivity(new Intent(JiuGongGeActivity.this,
						HZQQActivity.class));
				break;
			case R.id.button5:
				startActivity(new Intent(JiuGongGeActivity.this,
						ZhuGuanActivity.class));
				break;
			case R.id.button6:

				break;
			case R.id.button7:
				startActivity(new Intent(JiuGongGeActivity.this,
						KuFangActivity.class));
				break;
			case R.id.button8:
				startActivity(new Intent(JiuGongGeActivity.this,
						ChaKanActivity.class));
				break;

			}
		}
	};
}
